<?php 
defined('_JEXEC') or die('Restricted access'); 

?>

<form action="index.php" method="post" name="adminForm">
<div id="editcell">
	<table class="adminlist">
	<tfoot>
		<tr>
			<td colspan="6">
				<?php echo $this->pagination->getListFooter(); ?>
			</td>
		</tr>
	</tfoot>
	<thead>
		<tr>
			<th width="5">
				<?php echo JText::_( 'ID' ); ?>
			</th>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items) ; ?>);" />
			</th>			
			<th>
				<?php echo JText::_( 'Indirizzo' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Comune' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Descrizione' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Prezzo' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Tipo Operazione' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Tipo Immobile' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Pubblicato' ); ?>
			</th>
			<th>
				<?php echo JText::_( 'Data Pubblicazione' ); ?>
			</th>
		</tr>			
	</thead>

	<?php
	$k = 0;
	foreach ($this->items as $row)
	{	
	
		//$row = & $item;
		$checked 	= JHTML::_('grid.id',   $k, $row->id );
		$link 	= JRoute::_( 'index.php?option=com_totemtoo&controller=totemtoo&task=edit&cid[]='. $row->id );
		$published	= JHTML::_('grid.published', $row, $k);
		?>
		<tr class="<?php echo 'row$k'; ?>">
			<td>
				<?php echo $row->id; ?>
			</td>
			<td>
				<?php echo $checked; ?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->indirizzo; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->comune; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->descrizione; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->prezzo; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->operazione; ?></a>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->tipo_imm; ?></a>
			</td>
			<td>
				<?php echo $published; ?>
			</td>
			<td>
				<a href="<?php echo $link; ?>"><?php echo $row->data_published; ?></a>
			</td>
		</tr>
		<?php
			$k = $k+1;
	}
	?>
	</table>
	<input type="hidden" name="option" value="com_totemtoo" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="task" value="" />
</div>
</form>
